//
//  UIView+ShowBadgeView.m
//  ZYBHybrid
//
//  Created by ghwang on 16/4/18.
//  Copyright © 2016年 ghwang. All rights reserved.
//

#import "UIView+ShowBadgeView.h"
#import "XMBadgeView.h"

XMBadgeView *bagView;

@implementation UIView(BadgeView)
- (void)showBadgeViewWithNum:(NSString *)num{
    
    bagView = [[XMBadgeView alloc] initWithParentView :self alignment:XMBadgeViewAlignmentTopRight];
    bagView.badgeText = num;
}
- (void)hideBadgeView{

    [bagView reset];
    for (UIView *v in self.subviews) {
        if ([v isKindOfClass:[XMBadgeView class]]) {
            
            [v removeFromSuperview];

        }
    }
    
}

@end
